import java.util.Scanner;

public class B {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String t = sc.next();
		
		int i = 0;
		for(int k = 0; k < t.length(); k ++ ) {
			if(i < s.length() && t.charAt(k) == s.charAt(i)) {
				i ++ ;
				System.out.print((k + 1) +  " ");
			}
		}
	}
}
